//
//  VRBaseViewController.swift
//  VoiceRoom
//
//  Created by Rae on 2024/3/11.
//

import UIKit

@objc protocol VRBaseViewControllerProtocol {
    func controller_identification() -> String
    func controller_backImage() -> UIImage?
}

extension UIViewController: VRBaseViewControllerProtocol {
    
    func controller_identification() -> String {
        return NSStringFromClass(self.classForCoder)
    }
    
    func controller_backImage() -> UIImage? {
        UIImage(named: "")
    }
    
}

class VRBaseViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        navigation.bar.isHidden = true
        view.backgroundColor = .black
        
        // 设置 UIAlertController 的背景颜色和文本颜色
        UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .white
        UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).backgroundColor = "#1F1E18".toColor

    }
    
    @objc func clickBackButton(){
        
        self.navigationController?.popViewController(animated: true)
    }
    
    func imageToBase64String(image:UIImage)->Data?{
        let imageData = image.resetImgSize()
        return imageData
    }
}
